/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.cib.fintech.entrustedinvestment.biz.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author zhangqingkun
* @date 2020-10-16
**/
@Entity
@Data
@Table(name="t_tenant")
public class Tenant implements Serializable {

    @Id
    @Column(name = "id")
    @ApiModelProperty(value = "id")
    private Long id;

    @Column(name = "name")
    @ApiModelProperty(value = "租户名称")
    private String name;

    @Column(name = "ten_id")
    @ApiModelProperty(value = "租户id")
    private String tenId;

    @Column(name = "rsa_pub")
    @ApiModelProperty(value = "平台RSA公钥")
    private String rsaPub;

    @Column(name = "rsa_pri")
    @ApiModelProperty(value = "平台RSA私钥")
    private String rsaPri;

    @Column(name = "ten_rsa_pub")
    @ApiModelProperty(value = "租户RSA公钥")
    private String tenRsaPub;

    @Column(name = "return_url1")
    @ApiModelProperty(value = "租户异步通知地址1")
    private String returnUrl1;

    @Column(name = "return_url2")
    @ApiModelProperty(value = "租户异步通知地址2")
    private String returnUrl2;

    @Column(name = "return_url3")
    @ApiModelProperty(value = "租户异步通知地址3")
    private String returnUrl3;

    @Column(name = "return_url4")
    @ApiModelProperty(value = "租户异步通知地址4")
    private String returnUrl4;

    @Column(name = "return_url5")
    @ApiModelProperty(value = "租户异步通知地址5")
    private String returnUrl5;

    @Column(name = "remark")
    @ApiModelProperty(value = "备注")
    private String remark;

    @Column(name = "status")
    @ApiModelProperty(value = "租户状态0无效1有效")
    private Integer status;

    @Column(name = "create_time")
    @CreationTimestamp
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "create_by")
    @ApiModelProperty(value = "创建人")
    private String createBy;

    @Column(name = "update_time")
    @CreationTimestamp
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    @Column(name = "update_by")
    @ApiModelProperty(value = "跟新人")
    private String updateBy;

    public void copy(Tenant source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}